package nl.infodation.emr.pricingservice.controller;

import java.util.List;

import com.vaadin.data.util.BeanItem;

@SuppressWarnings("rawtypes")
public interface IController<T, Tsearch, Tid> {
	public boolean copyToEnvironment(int id, boolean clean);

	public boolean deleteById(Tid id);

	public boolean delete(T t);
	
	public List<T> findAll();

	public List<BeanItem> getPaginationList(int startPage, int pageSize);

	public List<BeanItem> getPaginationByCriteria(Tsearch t, int startPage,
			int pageSize);

	public T getObjectById(Tid id);
	
	/**
	 * Get all Entities by List of IDs
	 * @param ids
	 * @return
	 */
	public List<T> getEntitiesByIDs(List<Tid> ids);
	
	public long getTotalNumberItem();

	public long getTotalNumberItemByCriteria(Tsearch t);

	public boolean saveObject(T t);

	/**
	 * Save the list entity objects in one transaction
	 * 
	 * @param list
	 * @return
	 */
	public boolean save(List<T> list);

	/**
	 * Get list of Entity by many conditions of Entity
	 * @param t Entity
	 * @return
	 */
	public List<T> findByEntity (T t);
	
	/**
	 * Get list of Entity by many conditions of Entity
	 * @param t Entity
	 * @param firstResult Integer
	 * @param maxResults Integer
	 * @return
	 */
	public List<T> findByEntity (T t, int firstResult,
			int maxResults);
	
	/**
	 * Get first element of Entity list by many conditions of Entity
	 * @param t Entity
	 * @return
	 */
	public T findFirstByEntity(T t); 
	
}
